"use client";

import { templates } from "@/app/templates/templates";
import { useParams } from "next/navigation";

export default function ResumeEditorPage() {
  const params = useParams();
  const templateCode = params.templateCode;

  const template = templates.find((t) => t.code === templateCode);

  if (!template) {
    return <div>Template not found</div>;
  }

  const TemplateComponent = template.component;

  return (
    <div className="bg-gray-100 min-h-screen flex justify-center items-center">
      <div className="shadow-lg">
        <TemplateComponent resume={template.resume} />
      </div>
    </div>
  );
}
